using System;
using System.Globalization;

namespace FluffyUnderware.Curvy.Generator
{
	public struct SamplePointUData : IEquatable<SamplePointUData>
	{
		public int Vertex;

		public bool UVEdge;

		public float FirstU;

		public float SecondU;

		public SamplePointUData(int vt, bool uvEdge, float uv0, float uv1)
		{
			Vertex = vt;
			UVEdge = uvEdge;
			FirstU = uv0;
			SecondU = uv1;
		}

		public override string ToString()
		{
			return string.Format(CultureInfo.InvariantCulture, "SamplePointUData (Vertex={0},Edge={1},FirstU={2},SecondU={3}", Vertex, UVEdge, FirstU, SecondU);
		}

		public bool Equals(SamplePointUData other)
		{
			return Vertex == other.Vertex && UVEdge == other.UVEdge && FirstU.Equals(other.FirstU) && SecondU.Equals(other.SecondU);
		}

		public override bool Equals(object obj)
		{
			if (object.ReferenceEquals(null, obj))
			{
				return false;
			}
			return obj is SamplePointUData && Equals((SamplePointUData)obj);
		}

		public override int GetHashCode()
		{
			int vertex = Vertex;
			vertex = ((vertex * 397) ^ UVEdge.GetHashCode());
			vertex = ((vertex * 397) ^ FirstU.GetHashCode());
			return (vertex * 397) ^ SecondU.GetHashCode();
		}

		public static bool operator ==(SamplePointUData left, SamplePointUData right)
		{
			return left.Equals(right);
		}

		public static bool operator !=(SamplePointUData left, SamplePointUData right)
		{
			return !left.Equals(right);
		}
	}
}
